package com.asj.house.client;

import com.asj.house.config.feign.HouseRoomFeignConfig;
import com.asj.house.returns.RespEntity;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "houseRoomClient", url = "${house.url}", configuration = HouseRoomFeignConfig.class)
public interface HouseRoomClient {

    /**
     * 房源列表
     * @param pageNum
     * @param pageSize
     * @return
     */
    @GetMapping("/house-room/list")
    RespEntity listHouseRoom(@RequestParam(value = "pageNum", required = true) Integer pageNum,
                             @RequestParam(value = "pageSize", required = true) Integer pageSize);

    /**
     * 搜索房源
     * @param pageNum
     * @param pageSize
     * @param content
     * @return
     */
    @GetMapping("/house-room/search")
    RespEntity searchHouseRoom(@RequestParam(value = "pageNum", required = true) Integer pageNum,
                               @RequestParam(value = "pageSize", required = true) Integer pageSize,
                               @RequestParam(value = "content", required = true) String content);

    /**
     * 房源分类
     * @param pageNum
     * @param pageSize
     * @param type
     * @return
     */
    @GetMapping("/house-room/type")
    RespEntity typeHouseRoom(@RequestParam(value = "pageNum", required = true) Integer pageNum,
                             @RequestParam(value = "pageSize", required = true) Integer pageSize,
                             @RequestParam(value = "type", required = true) Integer type);

    /**
     * 房源城市分布
     * @param city
     * @return
     */
    @GetMapping("/house-room/city")
    RespEntity listCityRoom(@RequestParam(value = "city", required = true) String city);

    /**
     * 同城房源信息
     * @param roomId
     * @return
     */
    @GetMapping("/house-room/same")
    RespEntity sameCityRoom(@RequestParam(value = "roomId", required = true) Integer roomId);

    /**
     * 按照时间搜索房源
     * @param begin
     * @param end
     * @param num
     * @return
     */
    @GetMapping("/house-room/date")
    RespEntity searchRoomByDate(@RequestParam(value = "begin", required = true) String begin,
                                @RequestParam(value = "end", required = true) String end,
                                @RequestParam(value = "num", required = true) Integer num);
}
